home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
marque
/
marquee.frm
< prev
next >
Wrap
Text File
|
1995-05-08
|
2KB
|
80 lines
VERSION 2.00
Begin Form Form1
AutoRedraw = -1 'True
Caption = "Marquee Demo"
ClientHeight = 2775
ClientLeft = 1935
ClientTop = 1485
ClientWidth = 5520
Height = 3180
Left = 1875
LinkMode = 1 'Source
LinkTopic = "Form1"
ScaleHeight = 2775
ScaleWidth = 5520
Top = 1140
Width = 5640
Begin CommandButton Command2
Caption = "Exit"
Height = 495
Left = 2760
TabIndex = 2
Top = 2040
Width = 975
End
Begin CommandButton Command1
Caption = "Marquee"
Height = 495
Left = 1560
TabIndex = 1
Top = 2040
Width = 975
End
Begin PictureBox Picture1
AutoRedraw = -1 'True
BackColor = &H00FFFF00&
ForeColor = &H000000FF&
Height = 1335
Left = 120
ScaleHeight = 1305
ScaleWidth = 5265
TabIndex = 0
Top = 360
Width = 5295
End
End
Sub Command1_Click ()
'*NOTE: Picture 1 has AutoRedraw set True
'*Fore and Back Color are set in VB
'* Setup string and print formatting.
marquee$ = "It's EASY to do a simple Marquee in VB!"
picture1.fontname = "Helv"
picture1.fontsize = 48
picture1.fontbold = -1
thewidth = picture1.TextWidth(marquee$)
'*Add spaces for repeat when string scrolls off
Do While picture1.TextWidth(marquee$) < picture1.scalewidth + thewidth
marquee$ = marquee$ + " "
Loop
'*Display the moving marquee
Do
For x& = 1 To Len(marquee$)
a$ = Mid$(marquee$, 1, x&)
picture1.currentx = picture1.scalewidth - picture1.TextWidth(a$)
picture1.Print a$;
'*DoEvents() is required!
q = DoEvents()
'*Erases old string. AutoRedraw prevents flashing
picture1.Cls
Next
Loop
End Sub
Sub Command2_Click ()
End
End Sub